import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class InvocationHandlerImpl<T> implements InvocationHandler {
    private Speaker target;
    public InvocationHandlerImpl(T t){
        target = (Speaker) t;
    }
    public InvocationHandlerImpl() {
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("Class begin");
        Object invokeResult = method.invoke(target, args);
        System.out.println("Class end");
        return invokeResult;
    }
}
